<template>
  <div>
    <div class="img_top">
      <img width="100%" src="../../static/img/blank.jpg" />
    </div>
    <div class="about">
      <div class="about_btn">
        <div class="about_mess1">网站首页</div>
        <div class="about_mess2">个人中心</div>
      </div>
      <P class="about_p">你，我生命中一个重要的过客，我们之所以是过客，因为你未曾会为我停留。</P>
    </div>
    <div class="about_end">
      <div class="my">
        <div class="my_img">
          <img :src="users.avatar" />
        </div>
        <div class="my_inf">
          <div class="inf_right">昵称：</div>
          <div class="inf_left">{{users.nickName}}</div>
          <div class="inf_right">性别：</div>
          <div class="inf_left">{{sex}}</div>
          <div class="inf_right">生日：</div>
          <div class="inf_left">{{users.birthday}}</div>
          <div class="inf_right">邮箱：</div>
          <div class="inf_left">{{users.email}}</div>
          <div class="inf_right">QQ：</div>
          <div class="inf_left">{{users.qqNumber}}</div>
          <div class="inf_right">职业：</div>
          <div class="inf_left">{{users.occupation}}</div>
          <div class="inf_right">签名：</div>
          <div class="inf_left">{{users.summary}}</div>
        </div>
        <div class="my_inff">
          <div class="inf">

          </div>
          <div class="inf">

          </div>
          <div class="inf">

          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import axios from "axios";
  import Cookies from 'js-cookie';
export default {
  data() {
    return {
      users:{},
      sex: ''
    }
  },
  methods:{
    findByUsername:function (name) {
      var _this= this;
      axios.get('/api/user/message/'+name).then(function (res) {
        // this.users.email = res.data.email
        // this.users.birthday = res.data.birthday
        // this.users.gender = res.data.gender
        if (res.data.gender== 1){
          _this.sex= "男";
        }else {
          _this.sex= "女"
        }
        _this.users = res.data;

      })
    }
  },
  mounted:function () {
    var username = Cookies.get("username");
    this.findByUsername(username)
  }
};
</script>

<style>
.about {
  width: 100%;
  height: 60px;

  background-color: #f6f6f6;
  border-bottom: 1px #000 solid;
}
.about_end {
  width: 100%;
  height: 2000px;
  background-color: #f6f6f6;
  padding-top: 50px;
}
.about_btn {
  position: absolute;
  left: 160px;
  top: 310px;
}
.about_p {
  float: right;
  margin-right: 30px;
  line-height: 40px;
}
.about_mess1 {
  width: 100px;
  height: 40px;
  background-color: #000000;
  float: left;
  line-height: 40px;
  color: #ffffff;
  font-size: 14px;
}
.about_mess2 {
  width: 100px;
  height: 40px;
  background-color: #3a6ab5;
  float: left;
  line-height: 40px;
  color: #ffffff;
  font-size: 14px;
}
.my {
  width: 80%;
  height: 800px;
  background-color: #ffffff;
  box-shadow: #666 0 0 0.7rem;
  margin-left: 10%;
  padding-top: 30px;
}
.my_img {
  width: 165px;
  height: 210px;
  margin-left: 130px;

  float: left;
}
.my_inf {
  width: 700px;
  height: 290px;

  float: right;
  margin-right: 100px;
}
.my_inff {
  margin-top: 20px;
  width: 1002px;
  height: 300px;
  float: right;
  margin-right: 100px;
}
.inf_right {
  width: 130px;
  height: 40px;
line-height: 40px;
  float: left;
  border-bottom: #000 2px solid;
  font-weight: 1000;
}
.inf_left {
  width: 560px;
  height: 40px;
  float: right;
  border-bottom: #000 2px solid;

}
.inf{
  width: 900px;
  height: 150px;
  box-shadow: #666 0 0 0.7rem;
  margin-left: 51px;
  margin-top: 10px;
}
</style>
